package com.fredia.terp.mq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

import com.fredia.terp.config.EmailSenderUtil;
import com.fredia.terp.model.IEmail;  
  
//@Component
//public class Consumer2 {
//	@Autowired
//	private EmailSenderUtil emailSender;
//
//	// 使用JmsListener配置消费者监听的队列，其中text是接收到的消息
//	@JmsListener(destination = "email.queue")
//	@SendTo("out.queue")
//	public String receiveQueue(IEmail email) {
//
//		boolean bl = emailSender.sender(email.getAddr(), email.getSubject(), email.getContent());
//
//		return bl == false ? "失败" : "成功";
//	}
//}